/**
 * @(#)SmsShortCodeDAOImpl.java.java	1.0  18-07-2014 
 *
 * Copyright 2014 Viettel Telecome. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.viettel.core.dao.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.viettel.core.entities.service.SmsShortCode;
import com.viettel.core.exceptions.DataAccessException;
import com.viettel.core.repo.IRepository;

/**
 *  Mô tả đoạn code bên dưới
 *  @author: toantm1
 *  @since: 18-07-2014 - 11:23:23
 */

public class SmsShortCodeDAOImpl implements SmsShortCodeDAO{
	private IRepository repo;
	
	/** (non-Javadoc)
	 * @see com.viettel.core.dao.service.SmsShortCodeDAO#getSmsShortCodeById(java.lang.Long)
	 */
	@Override
	public SmsShortCode getSmsShortCodeById(Integer id) throws DataAccessException {
		return repo.getEntityById(SmsShortCode.class, id);
	}
	
	/** (non-Javadoc)
	 * @see com.viettel.core.dao.service.SmsShortCodeDAO#getListSmsShortCode()
	 */
	@Override
	public List<SmsShortCode> getListSmsShortCode() throws DataAccessException {
		return repo.getListBySQL(SmsShortCode.class, " select * from sms_short_code order by id ", null);
	}

	public IRepository getRepo() {
		return repo;
	}

	public void setRepo(IRepository repo) {
		this.repo = repo;
	}


}
